package diplom.shop.domain;

import java.util.List;


public class Device {
	
	private Long deviceId;
	private Category category;
	private String deviceName;
	private int cost;
	private int guaranty;
	private List<Image> images;

	
	public Device() {
		super();
	}


	public Device(Category category, String deviceName, int cost, int guaranty) {
		super();
		this.category = category;
		this.deviceName = deviceName;
		this.cost = cost;
		this.guaranty = guaranty;
	}


	public Device(Category category, String deviceName, int cost, int guaranty,
			List<Image> images) {
		super();
		this.category = category;
		this.deviceName = deviceName;
		this.cost = cost;
		this.guaranty = guaranty;
		this.images = images;
	}


	public Long getDeviceId() {
		return deviceId;
	}


	public void setDeviceId(Long deviceId) {
		this.deviceId = deviceId;
	}


	public Category getCategory() {
		return category;
	}


	public void setCategory(Category category) {
		this.category = category;
	}


	public String getDeviceName() {
		return deviceName;
	}


	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}


	public int getCost() {
		return cost;
	}


	public void setCost(int cost) {
		this.cost = cost;
	}


	public int getGuaranty() {
		return guaranty;
	}


	public void setGuaranty(int guaranty) {
		this.guaranty = guaranty;
	}


	public List<Image> getImages() {
		return images;
	}


	public void setImages(List<Image> images) {
		this.images = images;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((category == null) ? 0 : category.hashCode());
		result = prime * result + cost;
		result = prime * result
				+ ((deviceName == null) ? 0 : deviceName.hashCode());
		result = prime * result + guaranty;
		result = prime * result + ((images == null) ? 0 : images.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Device other = (Device) obj;
		if (category == null) {
			if (other.category != null)
				return false;
		} else if (!category.equals(other.category))
			return false;
		if (cost != other.cost)
			return false;
		if (deviceName == null) {
			if (other.deviceName != null)
				return false;
		} else if (!deviceName.equals(other.deviceName))
			return false;
		if (guaranty != other.guaranty)
			return false;
		if (images == null) {
			if (other.images != null)
				return false;
		} else if (!images.equals(other.images))
			return false;
		return true;
	}
	
	
	
}
